using System;
using System.Reflection;

using Microsoft.FxCop.Sdk.Introspection;

namespace Tyng.Rules
{
	public abstract class RuleBase<T> : BaseIntrospectionRule 
        where T : RuleBase<T>
	{
        protected RuleBase() : base(GetName(), GetRuleDataFile(), GetRuleDataAssembly()) { }

        private static string GetName()
        {
            return typeof(T).Name;
        }
        
        private static string GetRuleDataFile()
        {
            return typeof(T).Namespace + ".RuleData";
        }
                
        private static Assembly GetRuleDataAssembly()
        {
            return typeof(T).Assembly;
        }
	}
}
